package ru.urfc.portal.managers.impl;

import java.util.List;

import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;

import ru.urfc.portal.dao.filter.Filter;
import ru.urfc.portal.managers.BaseManager;
import ru.urfc.portal.managers.CatalogManager;
import ru.urfc.portal.model.Branch;
import ru.urfc.portal.model.admins.UserRole;
import ru.urfc.portal.model.admins.UserState;
import ru.urfc.portal.model.catalogs.DeviceState;
import ru.urfc.portal.model.documents.DocumentState;
import ru.urfc.portal.model.documents.DocumentType;

@Stateless
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public class CatalogManagerImpl extends BaseManager implements CatalogManager {

	@Override
	public List<Branch> getBranches() {
		return find(Branch.class, new Filter());
	}
	
	@Override
	public List<UserRole> getUserRoles() {
		return find(UserRole.class, new Filter());
	}

	@Override
	public List<UserState> getUserStates() {
		return find(UserState.class, new Filter());
	}
	
	public List<DeviceState> getDeviceStates() {
		return find(Branch.SVERD, DeviceState.class, new Filter());
	}

	@Override
	public List<DocumentState> getDocumentStates() {
		return find(DocumentState.class, new Filter());
	}

	@Override
	public List<DocumentType> getDocumentTypes() {
		return find(DocumentType.class, new Filter());
	}
	
}
